
#include "Vector.h"


Vector::Vector()
{


}

Vector::Vector(double X, double Y, double Z)
{
	dblX = X;
	dblY = Y;
	dblZ = Z;
}

double Vector::CalcularMagnitud(){
	return (double)sqrt(pow(dblX,2)+pow(dblY,2)+pow(dblZ,2));
}

void  Vector::ConvVectorUnitario(){
	double dblMagTemp;

	dblMagTemp = CalcularMagnitud();

	dblUnitX = dblX/dblMagTemp;
	dblUnitY = dblY/dblMagTemp;
	dblUnitZ = dblZ/dblMagTemp;
}

Vector4f::Vector4f()
{
}

Vector4f::Vector4f(double v1, double v2, double v3, double v4)
{
	dblV1 = v1;
	dblV2 = v2;
	dblV3 = v3;
	dblV4 = v4;
}

void Vector4f::setValor(int Nro,double v1)
{
	if(Nro==1)
	{
		dblV1 = v1;
	}
	else if(Nro==2)
	{
		dblV2 = v1;
	}
	else if(Nro==3)
	{
		dblV3 = v1;
	}
	else if(Nro==4)
	{
		dblV4 = v1;
	}
	else
	{
		//throw new exception;
	}

}

double Vector4f::getValor(int Nro){
	if(Nro==1){
		return dblV1;
	}else if(Nro==2){
		return dblV2;
	}else if(Nro==3){
		return dblV3;
	}else if(Nro==4){
		return dblV4;
	}else{
//          throw new exception;
            cout << "ERROR: numero de valor invalido" << endl;
            return 0;
	}
}

